package net.wofly.sale.order.util;

/**
 * @author lign
 * @version 1.0
 * @created 06-5月-2018 15:33:43
 */
public enum ReturnSalesStatus {
    草稿(10, "草稿"),
    待审核(20, "待审核"),
    审核通过(30, "审核通过"),
    结算(40, "结算"),
    入帐(50, "入帐"),
    取消(56, "取消"),
    驳回(39, "驳回");
    
    private Integer value;
    private String name;
    
    private ReturnSalesStatus(Integer value, String name) {
        this.value = value;
        this.name = name;
    }
    
    public static boolean isValueCorrect(Integer value) {
        for (ReturnSalesStatus forEnum : values()) {
            if (value == forEnum.getValue().intValue()) {
                return true;
            }
        }
        return false;
    }
    
    public static String getName(Integer value) {
        for (ReturnSalesStatus forEnum : values()) {
            if (value.equals(forEnum.getValue())) {
                return forEnum.name;
            }
        }
        return null;
    }
    
    public String getName() {
        return name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public Integer getValue() {
        return value;
    }
    
    public void setValue(Integer value) {
        this.value = value;
    }
}